package com.vastcom.tyauthcenter.dao;


import com.vastcom.tyauthcenter.model.Member;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface MemberDao extends JpaRepository<Member,String> {
    @Query("select m from Member  m where m.dept=:dept")
    List<Member> getMembersByDept(@Param("dept") String dept);

    @Query("select m from Member m where m.rolegroup=:role")
    List<Member> getMembersByRolegroup(@Param("role") String role);

    @Query("select m from Member m where m.name=:username and m.pass=:pass")
    List<Member> getMembersByNameAndPass(@Param("username") String name, @Param("pass") String pass);

    @Query("select m from Member  m where m.name=:username")
    List<Member> getMemberListByUserName(@Param("username") String username);

}
